package com.example.shuiyin.service;

import com.example.shuiyin.dto.MultipartUploadDto;
import com.example.shuiyin.dto.PartUploadResult;
import com.example.shuiyin.dto.UploadCompleteResult;
import com.example.shuiyin.entity.MultipartUpload;
import org.springframework.web.multipart.MultipartFile;

public interface MultipartUploadService {
    
    /**
     * 初始化多部分上传
     */
    MultipartUploadDto initMultipartUpload(Long userId, String fileName, Long fileSize, String contentType, Integer totalParts);
    
    /**
     * 上传分片
     */
    PartUploadResult uploadPart(Long userId, String uploadId, Integer partNumber, MultipartFile partFile);
    
    /**
     * 完成上传
     */
    UploadCompleteResult completeUpload(Long userId, String uploadId);
    
    /**
     * 取消上传
     */
    boolean abortUpload(Long userId, String uploadId);
    
    /**
     * 获取上传状态
     */
    MultipartUploadDto getUploadStatus(Long userId, String uploadId);
    
    /**
     * 清理过期的上传
     */
    int cleanupExpiredUploads();
} 